package be.redo.command;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import be.redo.model.entities.Airport;
import be.redo.model.entities.Flight;

/**
 * @author Frank
 * 
 */
public class FoundFlights implements Serializable {
	/**
	 * Generated serialVersionUID.
	 */
	private static final long serialVersionUID = -7684265972712530861L;
	/**
	 * Departure airport selected by the user
	 */
	private Airport departure;
	/**
	 * Destination airport selected by the user
	 */
	private Airport destination;
	/**
	 * List of Flights found by the datalayer
	 */
	private List<Flight> flights;

	public Airport getDeparture() {
		return departure;
	}

	public void setDeparture(Airport departure) {
		this.departure = departure;
	}

	public Airport getDestination() {
		return destination;
	}

	public void setDestination(Airport destination) {
		this.destination = destination;
	}

	public List<Flight> getFlights() {
		return Collections.unmodifiableList(flights);
	}

	public void setFlights(Collection<Flight> flights) {
		this.flights = new ArrayList<Flight>(flights.size());
		this.flights.addAll(flights);
	}

}
